package nl.boelen.game.server.level;

import nl.boelen.game.options.Option;
import nl.boelen.game.server.Server;

public class Map {
    private int CENTER = Option.WORLDSIZE / 2;
    private String mapName;
    private Server server;

    public Map(String mapName, Server server) {
        this.server = server;
        this.mapName = mapName;
    }

    public String getMapName() {
        return mapName;
    }

    public void setMapName(String mapName) {
        this.mapName = mapName;
    }

    public Chunk getChunk(int xPos, int yPos) {
        int xChunk = (xPos / Option.CHUNKSIZE) + CENTER;
        int yChunk = (yPos / Option.CHUNKSIZE) + CENTER;
        server.serverGUI.GUILog(xChunk + " " + yChunk);
        
        Chunk c = new Chunk(mapName, xChunk, yChunk);
        return c;
    }
}
